﻿using Abp.Domain.Entities;
using System.ComponentModel.DataAnnotations;

namespace DHJ.Cost.Tasks
{
    /// <summary>
    ///     装配关系
    /// </summary>
    public class AssemRel : Entity
    {
        /// <summary>
        ///     部组件条码号
        /// </summary>
        [Required]
        public string AssemId { get; set; }

        /// <summary>
        ///     零件条码号
        /// </summary>
        [Required]
        public string PartId { get; set; }

        /// <summary>
        ///     装配数量
        /// </summary>
        public int PartQuantity { get; set; }
    }

    public class FlatAssemRel
    {
        public FlatAssemRel()
        {
        }

        public FlatAssemRel(AssemRel assemRel, int assemQuantity)
        {
            AssemId = assemRel.AssemId;
            PartId = assemRel.PartId;
            AssemQuantity = assemQuantity;
            PartQuantity = assemRel.PartQuantity * assemQuantity;
        }

        public string AssemId { get; set; }

        public string PartId { get; set; }

        public int AssemQuantity { get; set; }

        public int PartQuantity { get; set; }
    }
}